package com.vidyu.datalayer.dataaccesscomponents;

import org.springframework.dao.DataAccessException;

import java.util.List;

/**
 * Base operations of DAO objects
 */
public interface BaseDao {

    /**
     * Execute a named query.
     * <p>A named query is defined in a Hibernate mapping file.
     * @param queryName the name of a Hibernate query in a mapping file
     * @return a {@link java.util.List} containing the results of the query execution
     * @throws org.springframework.dao.DataAccessException in case of Hibernate errors
     * @see org.hibernate.Session#getNamedQuery(String)
     */
//    public List findByNamedQuery(String queryName) throws DataAccessException;

    /**
     * Execute a named query, binding one value to a "?" parameter in
     * the query string.
     * <p>A named query is defined in a Hibernate mapping file.
     * @param queryName the name of a Hibernate query in a mapping file
     * @param value the value of the parameter
     * @return a {@link java.util.List} containing the results of the query execution
     * @throws org.springframework.dao.DataAccessException in case of Hibernate errors
     * @see org.hibernate.Session#getNamedQuery(String)
     */
    public List findByNamedQuery(String queryName, Object value) throws DataAccessException;

    /**
     * Execute a named query binding a number of values to "?" parameters
     * in the query string.
     * <p>A named query is defined in a Hibernate mapping file.
     * @param queryName the name of a Hibernate query in a mapping file
     * @param values the values of the parameters
     * @return a {@link java.util.List} containing the results of the query execution
     * @throws org.springframework.dao.DataAccessException in case of Hibernate errors
     * @see org.hibernate.Session#getNamedQuery(String)
     */
//    public List findByNamedQuery(String queryName, Object... values) throws DataAccessException;

    /**
     * Execute a named query, binding one value to a ":" named parameter
     * in the query string.
     * <p>A named query is defined in a Hibernate mapping file.
     * @param queryName the name of a Hibernate query in a mapping file
     * @param paramName the name of parameter
     * @param value the value of the parameter
     * @return a {@link java.util.List} containing the results of the query execution
     * @throws org.springframework.dao.DataAccessException in case of Hibernate errors
     * @see org.hibernate.Session#getNamedQuery(String)
     */
//    public  List findByNamedQueryAndNamedParam(String queryName, String paramName, Object value) throws DataAccessException;

    /**
     * Execute a named query, binding a number of values to ":" named
     * parameters in the query string.
     * <p>A named query is defined in a Hibernate mapping file.
     * @param queryName the name of a Hibernate query in a mapping file
     * @param paramNames the names of the parameters
     * @param values the values of the parameters
     * @return a {@link java.util.List} containing the results of the query execution
     * @throws org.springframework.dao.DataAccessException in case of Hibernate errors
     * @see org.hibernate.Session#getNamedQuery(String)
     */
//    public List findByNamedQueryAndNamedParam(String queryName, String[] paramNames, Object[] values) throws DataAccessException;

    /**
     * Execute a named query, binding the properties of the given bean to
     * ":" named parameters in the query string.
     * <p>A named query is defined in a Hibernate mapping file.
     * @param queryName the name of a Hibernate query in a mapping file
     * @param valueBean the values of the parameters
     * @return a {@link java.util.List} containing the results of the query execution
     * @throws org.springframework.dao.DataAccessException in case of Hibernate errors
     * @see org.hibernate.Query#setProperties
     * @see org.hibernate.Session#getNamedQuery(String)
     */
//    public  List findByNamedQueryAndValueBean(String queryName, Object valueBean) throws DataAccessException;

//    public int updateByNamedQuery(String queryName, Object[] values);

}
